#pragma once
//#include "../../Level4/Environment.hpp"
#include <list>
#include <map>
#include <fstream>
#include "Preprocessor.hpp"
#include "../Level5/Exception.hpp"
//#include <exception>
//class Class;
//class Interface;
//class Node;
namespace Level4
{
	class Node;
}
namespace Level5
{
	class Variable;
	class Class;
	class SyntaxParser
	{
	public:
		using Token = Preprocessor::Token;
		class SyntaxException :Exception
		{
		public:
			SyntaxException(const char32_t* const message, Token* token);
			virtual std::u32string What()const override
			{
				return _what;
			}
		};
		class Environment
		{
		public:
			Environment(Environment* parentEnvironment = nullptr);
			std::map<std::u32string, Variable*> variables;
			std::map<std::u32string, Class*> classes;
			Environment* parentEnvironment;
			Variable* FindVariable(std::u32string name);
			Class* FindClass(std::u32string name);
		};
		SyntaxParser() = default;
		virtual ~SyntaxParser();
		virtual std::list<Level4::Node*>* operator()(std::list<Level5::Preprocessor::Token>*) = 0;
		/*virtual std::list<Class*>* GetClass() = 0;
		virtual std::list<Interface*>* GetInterface() = 0;
		virtual std::list<Node*>* GetOperations() = 0;*/
	};
}